package com.yykj.tencent.im.server.bean.message;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yykj.tencent.im.client.message.MsgType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 地理位置消息元素
 *
 */
@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TIMLocationMsgElement extends TIMMsgElement {
    @JsonProperty("MsgContent")
    private LocationMsgContent msgContent;


    public TIMLocationMsgElement(LocationMsgContent msgContent) {
        super(MsgType.TIM_LOCATION_ELEM);
        this.msgContent = msgContent;
    }

    public TIMLocationMsgElement(String desc, Double latitude, Double longitude) {
        this(new LocationMsgContent(desc, latitude, longitude));
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class LocationMsgContent {
        @JsonProperty("Desc")
        private String desc;

        @JsonProperty("Latitude")
        private Double latitude;

        @JsonProperty("Longitude")
        private Double longitude;

    }
}
